package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCanteenMapper;
import com.ruoyi.system.domain.SysCanteen;
import com.ruoyi.system.service.ISysCanteenService;

/**
 * 食堂信息Service业务层处理
 *
 * @author jijinwu
 * @date 2024-07-22
 */
@Service
public class SysCanteenServiceImpl implements ISysCanteenService
{
    @Autowired
    private SysCanteenMapper sysCanteenMapper;

    /**
     * 查询食堂信息
     *
     * @param id 食堂信息主键
     * @return 食堂信息
     */
    @Override
    public SysCanteen selectSysCanteenById(Long id)
    {
        return sysCanteenMapper.selectSysCanteenById(id);
    }

    /**
     * 查询食堂信息列表
     *
     * @param sysCanteen 食堂信息
     * @return 食堂信息
     */
    @Override
    public List<SysCanteen> selectSysCanteenList(SysCanteen sysCanteen)
    {
        return sysCanteenMapper.selectSysCanteenList(sysCanteen);
    }

    /**
     * 新增食堂信息
     *
     * @param sysCanteen 食堂信息
     * @return 结果
     */
    @Override
    public int insertSysCanteen(SysCanteen sysCanteen)
    {
        sysCanteen.setCreateTime(DateUtils.getNowDate());
        return sysCanteenMapper.insertSysCanteen(sysCanteen);
    }

    /**
     * 修改食堂信息
     *
     * @param sysCanteen 食堂信息
     * @return 结果
     */
    @Override
    public int updateSysCanteen(SysCanteen sysCanteen)
    {
        sysCanteen.setUpdateTime(DateUtils.getNowDate());
        return sysCanteenMapper.updateSysCanteen(sysCanteen);
    }

    /**
     * 批量删除食堂信息
     *
     * @param ids 需要删除的食堂信息主键
     * @return 结果
     */
    @Override
    public int deleteSysCanteenByIds(Long[] ids)
    {
        return sysCanteenMapper.deleteSysCanteenByIds(ids);
    }

    /**
     * 删除食堂信息信息
     *
     * @param id 食堂信息主键
     * @return 结果
     */
    @Override
    public int deleteSysCanteenById(Long id)
    {
        return sysCanteenMapper.deleteSysCanteenById(id);
    }

    /**
     * 获取所有食堂信息
     * @return
     */
    @Override
    public List<SysCanteen> selectSysCanteenAll() {
        return sysCanteenMapper.selectSysCanteenAll();
    }
}
